SQL CREATE DATABASE
Use CREATE DATABASE statement to create a new database using mysql command. Login to MySQL server with administrative access to create a database.
Syntax
CREATE DATABASE database_name;
Example
Login to your MySQL server using the command line. You will get MySQL database prompt like mysql> . Now use CREATE DATABASE statement to create a database.
mysql> CREATE DATABASE mydb;
You can also use the following command directly on operating system command prompt without login to MySQL first.
$ mysqladmin -u root -p create mydb
To confirm that database is created properly use show databases command from database command prompt to list all databases.
1 2 3 4 5 6 7 8 9 10 11 | mysql> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | mydb | | performance_schema | +--------------------+ 4 rows in set (0.03 sec) |